home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Extensions… / Additions ƒ / Utilities.h < prev   
Encoding:
Text File  |  1996-03-20  |  2.7 KB  |  96 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2.  
  3.     FILENAME
  4.         Utilities.c
  5.  
  6.     DESCRIPTION
  7.         This header file contains declarations of the interface routines which are
  8.         available in the Utilities.c file.  These routines are utility routines (e.g. 
  9.         string manipulation routines) that are used by the other modules within the 
  10.         Additions printing extension.
  11.         
  12.  
  13.     COPYRIGHT
  14.         Copyright Apple Computer, Inc. 1991
  15.         All rights reserved. 
  16.     
  17.     INTERFACE ROUTINES
  18.         GetCopiesFromJob
  19.         MinNum
  20.         StrCopyMax
  21.         StrConcat
  22.         CheckBoxIsOn
  23.         EnableControlOnOff
  24.  
  25.     MODIFICATION HISTORY
  26.         05/15/91            ALA            Initial Implementation
  27.  
  28.  
  29. ------------------------------------------------------------------------------- */
  30.  
  31.  
  32. /*==================================== INTERFACE ROUTINES ====================================*/
  33.  
  34.  
  35. /* ===== GetCopiesFromJob =====
  36.  
  37.     Returns the number of copies specified in the job record; 1 if the record cannot be accessed.
  38. */
  39. long GetCopiesFromJob(                //    (out)    Number of copies in the job record
  40.     Collection    jobCollection);    //    (in)    Documents job record
  41.  
  42.  
  43. /* ===== MinNum =====
  44.  
  45.     Returns the minimum of 'long1' and 'long2'.
  46. */
  47. long MinNum(                // (out)    the minimum of long1 and long2
  48.     long        long1,        // (in)    the first long to consider
  49.     long        long2);        // (in)    the second long to consider
  50.  
  51.  
  52. /* ===== StrCopyMax =====
  53.  
  54.     Copies the contents of 'srcStr' to 'dstStr', but copies no more than maxToCopy characters
  55.     (not including the terminating '\0').
  56.  
  57.     Returns 'dstStr'.
  58. */
  59. char *StrCopyMax(                // (out)    pointer to 'dstStr'
  60.     const char    *srcStr,        // (in)    pointer to the string to copy (C string)
  61.     char            *dstStr,        // (in)    pointer to the string to receive the copy (C string)
  62.     long            maxToCopy);    //    (in)    maximum number of characters to copy
  63.  
  64.  
  65. /* ===== StrConcat =====
  66.  
  67.     Concatenates 'str2' to the end of 'str1' (it is assumed that 'str1'
  68.     can expand by strlen('str2') characters).
  69.  
  70.     Returns 'str1'.
  71. */
  72. char *StrConcat(                // (out)    pointer to 'str1' with 'str2' concatenated
  73.     char            *str1,        // (in)    pointer to the string to concatenate to (C string)
  74.     const char    *str2);        // (in)    pointer to the string to concatenate (C string)
  75.  
  76.  
  77. /* ===== CheckBoxIsOn =====
  78.  
  79.     CheckBoxIsOn turns true if a dialog checkbox button is checked; false otherwise.
  80. */
  81. Boolean CheckBoxIsOn(        //    (out)    Returns true if button is checked; false otherwise
  82.     DialogPtr    pDlg,            //    (in)    target dialog
  83.     short            whichItem);    //    (in)    dialog item to be changed
  84.  
  85.  
  86. /* ===== EnableControlOnOff =====
  87.  
  88.     EnableControlOnOff enables or disables the specified radio button.
  89. */
  90. void EnableControlOnOff(
  91.     DialogPtr    pDlg,            //    (in)    target dialog
  92.     short            whichItem,    //    (in)    dialog item to be changed
  93.     Boolean        enableIt);    //    (in)    T => enable the item; F => disable it
  94.  
  95.  
  96.